/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.appspot.trick.it.admin.bind;

import com.appspot.trick.it.admin.task.ParameterMstGetTask;
import com.appspot.trick.it.admin.task.ParameterMstPutTask;
import javafx.beans.binding.BooleanBinding;

/**
 *
 * @author imamura
 */
public class ParameterProgressVisibleBinding extends BooleanBinding {
    
    private final ParameterMstGetTask parameterMstGetTask;
    private final ParameterMstPutTask parameterMstPutTask;
    

    /**
     * コンストラクタ
     * @param parameterMstGetTask
     * @param parameterMstPutTask
     */
    public ParameterProgressVisibleBinding(
            ParameterMstGetTask parameterMstGetTask,
            ParameterMstPutTask parameterMstPutTask
            ) {
        this.parameterMstGetTask = parameterMstGetTask;
        this.parameterMstPutTask = parameterMstPutTask;

        super.bind(parameterMstGetTask.runningProperty());
        super.bind(parameterMstPutTask.runningProperty());
    }

    @Override
    protected boolean computeValue() {

        if(parameterMstGetTask.runningProperty().getValue()) return true;
        if(parameterMstPutTask.runningProperty().getValue()) return true;
        
        return false;
    }
}
